package com.yiqi.liebang.framework.api;


import com.suozhang.framework.component.http.Host;
import com.suozhang.framework.framework.AM;
import com.yiqi.liebang.framework.api.dependencies.ApiComponent;
import com.yiqi.liebang.framework.api.dependencies.DaggerApiComponent;



public class ApiLib {

    /**
     * 重新设置api地址
     * 调用完AM.init()方法后，才可调用此方法
     *
     * @param host
     */
    public static void resetHost(Host host) {

        AM.buildComponent(AM.app());
        initApiComponent();
        AM.api().setHost(host);
    }


    private static ApiComponent apiComponent;


    public static void initApiComponent() {
        apiComponent = DaggerApiComponent.builder().build();
    }

    public static ApiComponent apiComponent() {
        return apiComponent;
    }
}
